<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wwwApp: template.php File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">wwwApp
   </div>
   <div id="projectbrief">A web app for workshop organizing, recruitment and qualification</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">template.php File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="template_8php_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html">SimpleTemplate</a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4a7e99592a2690b33d53c9bcc8fd3008"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a4a7e99592a2690b33d53c9bcc8fd3008">parseUserHTML</a> ($html)</td></tr>
<tr class="memitem:a9b9585537fe5238d4d5b54478251ccfa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a9b9585537fe5238d4d5b54478251ccfa">getTipJS</a> ($tip)</td></tr>
<tr class="memitem:a4fbd311bbd72b7beba6f27fe63b0acb1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a4fbd311bbd72b7beba6f27fe63b0acb1">getIcon</a> ($name, $tip=false, $href=false)</td></tr>
<tr class="memitem:a93f1d2b73c6defc9f0af8e7e17b0b47d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a93f1d2b73c6defc9f0af8e7e17b0b47d">getButton</a> ($title, $href, $icon=false)</td></tr>
<tr class="memitem:ac3f1fe2bff93b1d2b6f50ecca43e836b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#ac3f1fe2bff93b1d2b6f50ecca43e836b">format</a> ($string)</td></tr>
<tr class="memitem:a93341043d3d499b0d03eb7ebbe39fdaf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a93341043d3d499b0d03eb7ebbe39fdaf">formatAssoc</a> ($string, $assoc)</td></tr>
<tr class="memitem:a37d777a190ddf72ef569a520257dd64d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a37d777a190ddf72ef569a520257dd64d">alternate</a> ()</td></tr>
<tr class="memitem:a3bbebc058e2a5749c5129ef04f2db578"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="template_8php.html#a3bbebc058e2a5749c5129ef04f2db578">buildTableHTML</a> ($rows, $headers=null)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a37d777a190ddf72ef569a520257dd64d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">alternate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00202">202</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="tutoring_8php_source.html#l00064">actionViewTutoringApplications()</a>, <a class="el" href="tasks_8php_source.html#l00248">buildParticipantList()</a>, <a class="el" href="template_8php_source.html#l00214">buildTableHTML()</a>, and <a class="el" href="tasks_8php_source.html#l00009">buildTaskList()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        <span class="keyword">static</span> $memory = array();</div>
<div class="line">        $args = func_get_args();</div>
<div class="line">        $array = &amp;$memory[serialize($args)];</div>
<div class="line">        <span class="keywordflow">if</span> (!isset($array))</div>
<div class="line">                $array = $args;</div>
<div class="line">        <span class="keywordflow">while</span>(!(list($key,$val) = each($array)))</div>
<div class="line">                reset($array);</div>
<div class="line">        <span class="keywordflow">return</span> $val;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a3bbebc058e2a5749c5129ef04f2db578"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">buildTableHTML </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$rows</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$headers</em> = <code>null</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00214">214</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="admin_8php_source.html#l00036">actionAdminUsers()</a>, <a class="el" href="summary_8php_source.html#l00132">actionListArrivalData()</a>, <a class="el" href="summary_8php_source.html#l00191">actionListDailyCounts()</a>, and <a class="el" href="summary_8php_source.html#l00096">actionListPersonalData()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        echo <span class="stringliteral">&#39;&lt;table style=&quot;width:auto&quot;&gt;&#39;</span>;</div>
<div class="line">        <span class="keywordflow">if</span> ($headers)</div>
<div class="line">        {</div>
<div class="line">                echo<span class="stringliteral">&#39;&lt;thead&gt;&lt;tr&gt;&#39;</span>;</div>
<div class="line">                <span class="keywordflow">foreach</span> ($headers as $h)</div>
<div class="line">                {</div>
<div class="line">                        echo <span class="stringliteral">&#39;&lt;th&gt;&#39;</span>;</div>
<div class="line">                        <span class="keywordflow">if</span> (is_array($h))</div>
<div class="line">                        {</div>
<div class="line">                                <span class="keywordflow">if</span> (!empty($h[<span class="stringliteral">&#39;order&#39;</span>]))</div>
<div class="line">                                        echo <span class="stringliteral">&#39;&lt;a href=&quot;?order=&#39;</span>. htmlspecialchars(urlencode($h[<span class="stringliteral">&#39;order&#39;</span>])) .<span class="stringliteral">&#39;&quot;&gt;&#39;</span>;</div>
<div class="line">                                echo $h[<span class="stringliteral">&#39;description&#39;</span>];</div>
<div class="line">                                <span class="keywordflow">if</span> (!empty($h[<span class="stringliteral">&#39;order&#39;</span>]))</div>
<div class="line">                                        echo <span class="stringliteral">&#39;&lt;/a&gt;&#39;</span>;</div>
<div class="line">                        }</div>
<div class="line">                        <span class="keywordflow">else</span></div>
<div class="line">                                echo $h;</div>
<div class="line">                        echo <span class="stringliteral">&#39;&lt;/th&gt;&#39;</span>;</div>
<div class="line">                }</div>
<div class="line">                echo <span class="stringliteral">&#39;&lt;/tr&gt;&lt;/thead&gt;&#39;</span>;</div>
<div class="line">        }</div>
<div class="line">        echo <span class="stringliteral">&#39;&lt;tbody&gt;&#39;</span>;</div>
<div class="line">        <span class="keywordflow">foreach</span> ($rows as $row)</div>
<div class="line">        {</div>
<div class="line">                echo <span class="stringliteral">&#39;&lt;tr class=&quot;&#39;</span>. <a class="code" href="template_8php.html#a37d777a190ddf72ef569a520257dd64d">alternate</a>(<span class="stringliteral">&#39;even&#39;</span>, <span class="stringliteral">&#39;odd&#39;</span>) .<span class="stringliteral">&#39;&quot;&gt;&#39;</span>;</div>
<div class="line">                <span class="keywordflow">if</span> ($headers)</div>
<div class="line">                        <span class="keywordflow">foreach</span> ($headers as $key =&gt; $h)</div>
<div class="line">                                <span class="keywordflow">if</span> (array_key_exists($key, $row))</div>
<div class="line">                {</div>
<div class="line">                        echo <span class="stringliteral">&#39;&lt;td&gt;&#39;</span>. $row[$key] .<span class="stringliteral">&#39;&lt;/td&gt;&#39;</span>;</div>
<div class="line">                        unset($row[$key]);</div>
<div class="line">                }</div>
<div class="line">                <span class="keywordflow">foreach</span> ($row as $key =&gt; $value)</div>
<div class="line">                                echo <span class="stringliteral">&#39;&lt;td&gt;&#39;</span>. $value .<span class="stringliteral">&#39;&lt;/td&gt;&#39;</span>;</div>
<div class="line"></div>
<div class="line">                echo <span class="stringliteral">&#39;&lt;/tr&gt;&#39;</span>;</div>
<div class="line">        }</div>
<div class="line">        echo <span class="stringliteral">&#39;&lt;/tbody&gt;&lt;/table&gt;&#39;</span>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ac3f1fe2bff93b1d2b6f50ecca43e836b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">format </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00178">178</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        $args = func_get_args();</div>
<div class="line">        array_shift($args);</div>
<div class="line">        <span class="keywordflow">foreach</span> ($args as $i =&gt; $arg)</div>
<div class="line">                $string = str_replace(<span class="charliteral">&#39;$&#39;</span>. ($i+1), $arg, $string);</div>
<div class="line">        <span class="keywordflow">return</span> $string;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a93341043d3d499b0d03eb7ebbe39fdaf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">formatAssoc </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$assoc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00189">189</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="page_8php_source.html#l00062">Page\addMenuBox()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        $names = array();</div>
<div class="line">        $values = array();</div>
<div class="line">        <span class="keywordflow">foreach</span> ($assoc as $name =&gt; $value)</div>
<div class="line">        {</div>
<div class="line">                $names[]= <span class="stringliteral">&quot;%$name%&quot;</span>;</div>
<div class="line">                $values[]= $value;</div>
<div class="line">        }</div>
<div class="line">        <span class="keywordflow">return</span> str_replace($names, $values, $string);</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a93f1d2b73c6defc9f0af8e7e17b0b47d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">getButton </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$title</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$href</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$icon</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00169">169</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="workshop_8php_source.html#l00339">actionShowWorkshopTasks()</a>, <a class="el" href="tutoring_8php_source.html#l00089">actionViewTutoringApplication()</a>, and <a class="el" href="tasks_8php_source.html#l00009">buildTaskList()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        $href = htmlspecialchars($href, ENT_QUOTES);</div>
<div class="line">        $button = $title;</div>
<div class="line">        <span class="keywordflow">if</span> ($icon)  $button = <a class="code" href="template_8php.html#a4fbd311bbd72b7beba6f27fe63b0acb1">getIcon</a>($icon, <span class="stringliteral">&#39;&#39;</span>) . $button;</div>
<div class="line">        <span class="keywordflow">return</span> <span class="stringliteral">&quot;&lt;a class=&#39;button&#39; href=&#39;$href&#39;&gt;$button&lt;/a&gt;&quot;</span>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a4fbd311bbd72b7beba6f27fe63b0acb1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">getIcon </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$tip</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$href</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00158">158</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="tutoring_8php_source.html#l00064">actionViewTutoringApplications()</a>, <a class="el" href="page_8php_source.html#l00062">Page\addMenuBox()</a>, <a class="el" href="user_8php_source.html#l00146">addUserMenuBox()</a>, <a class="el" href="tasks_8php_source.html#l00248">buildParticipantList()</a>, <a class="el" href="tasks_8php_source.html#l00009">buildTaskList()</a>, <a class="el" href="template_8php_source.html#l00169">getButton()</a>, and <a class="el" href="user_2utils_8php_source.html#l00090">getUserBadge()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        $class = strtr($name, <span class="charliteral">&#39;.&#39;</span>, <span class="charliteral">&#39;_&#39;</span>);</div>
<div class="line">        $js = <a class="code" href="template_8php.html#a9b9585537fe5238d4d5b54478251ccfa">getTipJS</a>($tip);</div>
<div class="line">        <span class="keywordflow">if</span> ($tip===<span class="keyword">false</span>)  $tip = substr($name,0,-4);</div>
<div class="line">        $icon = <span class="stringliteral">&quot;&lt;span class=&#39;$class icon&#39; $js&gt;&lt;/span&gt;&quot;</span>;</div>
<div class="line">        <span class="comment">//$icon = &quot;&lt;img class=&#39;icon&#39; src=&#39;images/icons/$name&#39; alt=&#39;$title&#39; title=&#39;$title&#39;/&gt;&quot;;</span></div>
<div class="line">        <span class="keywordflow">if</span> ($href)  $icon = <span class="stringliteral">&quot;&lt;a class=&#39;iconLink&#39; href=&#39;$href&#39;&gt;$icon&lt;/a&gt;&quot;</span>;</div>
<div class="line">        <span class="keywordflow">return</span> $icon;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a9b9585537fe5238d4d5b54478251ccfa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">getTipJS </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$tip</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00151">151</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="admin_8php_source.html#l00036">actionAdminUsers()</a>, <a class="el" href="profile_8php_source.html#l00280">actionEditAdditionalInfo()</a>, <a class="el" href="profile_8php_source.html#l00084">actionEditProfile()</a>, <a class="el" href="admin_8php_source.html#l00124">actionEditUserStatus()</a>, <a class="el" href="summary_8php_source.html#l00003">actionShowCorrelation()</a>, <a class="el" href="tasks_8php_source.html#l00344">actionShowPointsTable()</a>, <a class="el" href="user_8php_source.html#l00146">addUserMenuBox()</a>, <a class="el" href="tasks_8php_source.html#l00009">buildTaskList()</a>, and <a class="el" href="template_8php_source.html#l00158">getIcon()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        <span class="keywordflow">if</span> (strlen(trim($tip))==0)  <span class="keywordflow">return</span> <span class="charliteral">&#39; &#39;</span>;</div>
<div class="line">        $tip = htmlspecialchars(addcslashes($tip, <span class="stringliteral">&quot;\\\&quot;\n\r&quot;</span>), ENT_QUOTES);     <span class="comment">// Tested.</span></div>
<div class="line">        <span class="keywordflow">return</span> <span class="stringliteral">&quot; onmouseout=&#39;tipoff()&#39; onmouseover=&#39;tipon(this,\&quot;$tip\&quot;)&#39; &quot;</span>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a4a7e99592a2690b33d53c9bcc8fd3008"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">parseUserHTML </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$html</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00109">109</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

<p>Referenced by <a class="el" href="tasks_8php_source.html#l00138">actionDeleteTask()</a>, <a class="el" href="tasks_8php_source.html#l00166">actionEditSolution()</a>, <a class="el" href="admin_8php_source.html#l00124">actionEditUserStatus()</a>, <a class="el" href="profile_8php_source.html#l00015">actionShowProfile()</a>, <a class="el" href="tasks_8php_source.html#l00430">actionShowTaskSolutions()</a>, <a class="el" href="workshop_8php_source.html#l00339">actionShowWorkshopTasks()</a>, <a class="el" href="form_8php_source.html#l00262">buildFormRow()</a>, and <a class="el" href="tasks_8php_source.html#l00009">buildTaskList()</a>.</p>
<div class="fragment"><div class="line">{</div>
<div class="line">        <span class="comment">// TODO: test prevention of XSS attacks with HTMLPurifier.</span></div>
<div class="line"></div>
<div class="line">        <span class="comment">// DEPRECATED: Using mathjax instead, see html.php</span></div>
<div class="line">        <span class="comment">//Parse [tex]code[/tex] into &lt;img src=&quot;pathtorenderer.cgi?code&quot;/&gt;.</span></div>
<div class="line">        <span class="comment">/*preg_match_all(&quot;#\\[tex\\](.*?)\\[/tex\\]#si&quot;,$html,$tex_matches);</span></div>
<div class="line"><span class="comment">        for ($i=0; $i &lt; count($tex_matches[0]); $i++) {</span></div>
<div class="line"><span class="comment">                $pos = strpos($html, $tex_matches[0][$i]); // TODO low: this seems stupid?</span></div>
<div class="line"><span class="comment">                $len = strlen($tex_matches[0][$i]);</span></div>
<div class="line"><span class="comment">                $latex_formula = $tex_matches[1][$i];</span></div>
<div class="line"><span class="comment">                $url = &#39;http://&#39;. $_SERVER[&#39;HTTP_HOST&#39;] . &#39;/cgi-bin/mimetex.cgi?&#39;;</span></div>
<div class="line"><span class="comment">                $url .= htmlspecialchars($latex_formula, ENT_QUOTES);</span></div>
<div class="line"><span class="comment">                $img = &quot;&lt;img src=&#39;$url&#39; alt=&#39;[tex]&quot;. htmlspecialchars($latex_formula, ENT_QUOTES) .</span></div>
<div class="line"><span class="comment">                        &quot;[/tex](&quot;. _(&#39;missing picture&#39;). &quot;)&#39; class=&#39;latex&#39; align=&#39;absmiddle&#39;/&gt;&quot;;</span></div>
<div class="line"><span class="comment">                $html = substr_replace($html, $img, $pos, $len);</span></div>
<div class="line"><span class="comment">        }*/</span></div>
<div class="line"></div>
<div class="line">        <span class="comment">// TODO see why TinyMCE includes html-escaped comment tags with MS Word stuff.</span></div>
<div class="line">        $offset = 0;</div>
<div class="line">        <span class="keywordflow">while</span> (($pos = strpos($html, <span class="stringliteral">&#39;&amp;lt;!--&#39;</span>, $offset)) !== <span class="keyword">false</span>)</div>
<div class="line">        {</div>
<div class="line">                $end = strpos($html, <span class="stringliteral">&#39;--&amp;gt;&#39;</span>, $pos+2);</div>
<div class="line">                global <a class="code" href="index_8php.html#ae1848ae8dc4014bc7c680e5504a8eef0">$PAGE</a>;</div>
<div class="line">                <span class="keywordflow">if</span> ($end === <span class="keyword">false</span>)</div>
<div class="line">                        $PAGE-&gt;addMessage(<span class="stringliteral">&#39;MSWord copy-paste closing tag not found.&#39;</span>, <span class="stringliteral">&#39;exception&#39;</span>);</div>
<div class="line">                $end += strlen(<span class="stringliteral">&#39;--&amp;gt;&#39;</span>);</div>
<div class="line">                $html = substr_replace($html, <span class="stringliteral">&#39;&#39;</span>, $pos, $end-$pos);</div>
<div class="line">                $offset = $pos;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        $config = HTMLPurifier_Config::createDefault();</div>
<div class="line">        $purifier = <span class="keyword">new</span> HTMLPurifier($config);</div>
<div class="line">        $html = $purifier-&gt;purify($html);</div>
<div class="line"></div>
<div class="line">        $html = <span class="stringliteral">&#39;&lt;span class=&quot;userHTML&quot;&gt;&#39;</span>. $html .<span class="stringliteral">&#39;&lt;/span&gt;&#39;</span>;</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> $html;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Sep 8 2013 17:44:57 for wwwApp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
